package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the SERVICE_TYPE database table.
 * 
 */
@Entity
@Table(name="SERVICE_TYPE")
@NamedQuery(name="ServiceType.findAll", query="SELECT s FROM ServiceType s")
public class ServiceType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="SERVICE_TYPE_SERVICEID_GENERATOR", sequenceName="SEQ_46")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SERVICE_TYPE_SERVICEID_GENERATOR")
	@Column(name="SERVICE_ID")
	private long serviceId;

	@Column(name="SERVICE_CONTAIN")
	private String serviceContain;

	//bi-directional many-to-one association to CustomRecord
	@OneToMany(mappedBy="serviceType")
	private List<CustomRecord> customRecords;

	public ServiceType() {
	}
	public ServiceType(long serviceId, String serviceContain) {
		super();
		this.serviceId = serviceId;
		this.serviceContain = serviceContain;
	}

	@Override
	public String toString() {
		return "ServiceType [serviceId=" + serviceId + ", serviceContain=" + serviceContain + "]";
	}
	
	
	
	
	
	public long getServiceId() {
		return this.serviceId;
	}

	public void setServiceId(long serviceId) {
		this.serviceId = serviceId;
	}

	public String getServiceContain() {
		return this.serviceContain;
	}

	public void setServiceContain(String serviceContain) {
		this.serviceContain = serviceContain;
	}

	public List<CustomRecord> getCustomRecords() {
		return this.customRecords;
	}

	public void setCustomRecords(List<CustomRecord> customRecords) {
		this.customRecords = customRecords;
	}

	public CustomRecord addCustomRecord(CustomRecord customRecord) {
		getCustomRecords().add(customRecord);
		customRecord.setServiceType(this);

		return customRecord;
	}

	public CustomRecord removeCustomRecord(CustomRecord customRecord) {
		getCustomRecords().remove(customRecord);
		customRecord.setServiceType(null);

		return customRecord;
	}

}